# ------------yield 实现-------------------
import queue
import time
q=queue.Queue()

def Cousumer(name):
    print("准备开始吃包子>>>>>>>>")
    while True:
        new_baozi = yield
        print("cousumer %s has eat %s baozi" %(name,new_baozi))
def Producer(name):
    r = con1.__next__()
    r = con2.__next__()
    n = 0
    while 1:
        time.sleep(1)
        print("Producer %s  is making baozi %s and %s" %(name,n,n+1))
        con1.send(n)
        con2.send(n+1)
        n +=2
if __name__ == '__main__':
   con1 =Cousumer("c1")
   con2 = Cousumer("c2")
   p = Producer("1号厨师")